
const app = getApp()

function toggleTabBar(index) {
    if (index == 0) {
        wx.switchTab({
            url: "/pages/index/index"
        })
    } else if (index == 1) {
        wx.switchTab({
            url: "/pages/order/index/index"
        })
    } else if (index == 2) {
        wx.switchTab({
            url: "/report-package/pages/index/index"
        })
    } else if (index == 3) {
        wx.switchTab({
            url: "/pages/usercenter/index/index"
        })
    }
    app.globalData.tabBarIndex = index
}

module.exports = {
    toggleTabBar: toggleTabBar
}
